<?php
Route::get("/","Home\IndexController@index");

Route::namespace('Admin')->prefix('admin')->group(function () {
	Route::get("/","LoginController@index")->name('loginView');
	Route::get("/login/checkVerify","LoginController@checkVerify");
	Route::post("/login/login","LoginController@login");
	Route::any("/login/logout","LoginController@logout");
	Route::middleware('autoLogout')->any("/index/getmenu","IndexController@getMenu");

	$nodes = App\Http\Models\Admin\Node::where('action','<>','#')->where('src','<>','')->get();
	foreach($nodes as $node) {
		$url = "/".$node->src;
		$ctrl_action = $node->ctrl."Controller@".$node->action;
		Route::middleware('autoLogout')->match(['get', 'post'],$url,$ctrl_action)->middleware('mkBreadcurmb');
	}
});

Route::namespace('Home')->prefix('home')->group(function () {

});
